package com.blackcat.trycatch.controller;

import com.blackcat.trycatch.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Title 异常抛出测试
 * @Description
 * @author zhanghui
 * @date 2020年12月08日 14:14
 * @version V1.0
 * @see
 * @since V1.0
 */
@RestController
public class TestController {

	@Autowired(required = false)
	private TestService testService;

	@RequestMapping(value = "get1",method = RequestMethod.GET)
	public String test1(){
		testService.test1();
		return "ok";
	}

	@RequestMapping(value = "get2",method = RequestMethod.GET)
	public String test2() throws Exception {
		testService.test2();
		return "ok";
	}

	@RequestMapping(value = "get3",method = RequestMethod.GET)
	public String test3(){
		testService.test3();
		return "ok";
	}


}
